<?php
//Data loading
//By Bayu
$pdf=new COAPDFReport("P","mm","Letter");
$pdf->DBConnection($DBConnection->dbc);
$pdf->AddPage();
$pdf->GenerateReport();
$pdf->Output();

class COAPDFReport extends PDF {
  function COAPDFReport($Page,$Size,$PageMode) {
    parent::PDF($Page,$Size,$PageMode);
    $this->ColumnSize = array(85,30,30,30,30);
    $this->TableName = "tblcoa";
    $this->AddFont('arialn','','arialn.php');
    $this->SetFont('arialn','',10);
    $this->SetLeftMargin(5);
  }
  
  function Header() {
      $perush = GetCompanyName();
      $this->Cell(60,5,'TEST',0,1,'C',0);
  }

  function DBConnection ($Conn) {
    $this->DBConnection = $Conn; 
  }

  function GenerateReport() {
    $this->BlankLine();
  }

  function BlankLine() {
    $this->WriteLine("","","","","");
  }

  function WriteLine($no, $description, $jumlah, $skada, $kdact,$order, $isblock="0") {
    if ($isblock=="1") $border = "1"; else $border = "LR";
    $this->Cell($this->ColumnSize[0],5,$no,$border,0,'L',0);
  	$this->Cell($this->ColumnSize[1],5,$description,$border,0,'R',0);
  	$this->Cell($this->ColumnSize[2],5,$jumlah,$border,0,'R',0);
  	$this->Cell($this->ColumnSize[3],5,$skada,$border,0,'R',0);
  	$this->Cell($this->ColumnSize[3],5,$order,$border,0,'R',0);
    $this->Cell($this->ColumnSize[4],5,$kdact,$border,0,'R',0);
    $this->Ln();
  }

}
?>
